package com.lightheart.sphr.xiaobinggan.scale.ui

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.widget.TextView
import com.lightheart.sphr.xiaobinggan.R
import kotlinx.android.synthetic.main.activity_scale.*

class ScaleActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_scale)
        rulerView.setOnNumSelectListener { selectedNum ->
            val tvNum: TextView = findViewById(R.id.tvNum)
            tvNum.text = "$selectedNum cm"
            tvNum.setTextColor(rulerView.indicatorColor)
        }
    }
}